/*
 * Alloy Analyzer
 * Copyright (c) 2002 Massachusetts Institute of Technology
 *
 * The Alloy Analyzer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * The Alloy Analyzer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with the Alloy Analyzer; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package alloy.ast;

/**
 * Interface implemented by AST {@link Node}s representing an Alloy formula, such as "A in B".  Alloy AST nodes are
 * of three kinds: {@link Formula}, {@link Expr} or {@link IntExpr}; the root of the AST
 * is always a {@link Formula}.
 *
 * @see alloy.transl.FormulaTransl
 * @see FindCommand
 */
public interface Formula extends Node {

    /** @return the conjunction of this with another formula */
    Formula and(Formula other_);

    /** @return the disjunction of this with another formula */
    Formula or(Formula other_);

    /** @return this iff another formula */
    Formula iff(Formula other_);

    /** @return the negation of this */
    Formula not();

    /** @return this implies other_, else else_ */
    Formula implies(Formula other_, Formula else_);
    
    /** @return this implies other_ */
    Formula implies(Formula other_);
}
